package com.ddwl.gate.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.gate.service.KuaiDi100Service;
import com.ddwl.schema.bo.gate.kuaiDi100.QueryBo;
import com.ddwl.schema.vo.base.RestVo;
import com.ddwl.schema.vo.gate.kuaiDi100.QueryTrackVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @Author hemiaojun
 * @Date 2021/10/12 10:44
 */
@Api(tags = "快递100对接服务")
@RequestMapping("/kuaiDi100")
@RestController
public class KuaiDi100Controller extends BaseController {

    @Resource
    private KuaiDi100Service kuaiDi100Service;


    @PostMapping("/query")
    @ApiOperation("实时快递查询")
    @Auth(product = {BaseEnum.ProductEnum.FENXIAO, BaseEnum.ProductEnum.WBM,BaseEnum.ProductEnum.WBM_OFFICE, BaseEnum.ProductEnum.MALL, BaseEnum.ProductEnum.API, BaseEnum.ProductEnum.BYTE_DANCE, BaseEnum.ProductEnum.CONSOLE, BaseEnum.ProductEnum.SHOP_CONSOLE})
    public RestVo<QueryTrackVo> query(@Valid @RequestBody QueryBo bo){
        return RestVo.ok(kuaiDi100Service.queryTrack(bo));
    }


}
